package com.tgy.log;

import org.springframework.aop.AfterReturningAdvice;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

/***
 * @ClassName: AfterLog
 * @Description: 后置增强
 * @Auther: 送一一块二向箔
 * @Date: 17:06 2021/12/17
 * @version : V1.0
 */
@Component("afterLog1")
public class AfterLog implements AfterReturningAdvice {

    //可以拿到真实对象返回结果
    @Override
    public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
        System.out.println("执行了" + target.getClass().getName()
                +"的"+method.getName()+"方法,"
                +"返回值："+returnValue);
    }
}
